package cn.psvmc.cxzapi.model.goods;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 商品规格表
 *
 * @Author auto
 * @Date 2024-08-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_goods_specs")
public class TGoodsSpecs implements Serializable {

    @Serial
    private static final long serialVersionUID = -1180033292252766158L;
    //商品规格id
    @TableId(value = "gsid", type = IdType.AUTO)
    private Integer gsid;

    //商品id
    @TableField("goods_id")
    private Integer goodsId;

    //租赁方案（1 租完需归还 2租完可归还/买断 3租完即送）
    @TableField("type")
    private Integer type;

    //属性组合
    @TableField("name")
    private String name;

    //是否缺货（0不缺 1缺）
    @TableField("out_stock")
    private Integer outStock;

    //是否可续租（0不可 1可）
    @TableField("relet")
    private Integer relet;

    //押金
    @TableField("deposit")
    private Double deposit;

    //买断价格
    @TableField("buy_price")
    private Double buyPrice;

    //库存
    @TableField("stock")
    private Integer stock;

    //排序
    @TableField("specs_order")
    private Integer specsOrder;

    //创建人id
    @TableField(value = "createid", fill = FieldFill.INSERT)
    private Integer createid;

    //创建时间
    @TableField(value = "createtime", fill = FieldFill.INSERT)
    private LocalDateTime createtime;

    @TableLogic
    @TableField("deleted")
    private Integer deleted;

    //规格租金
    @TableField(exist = false)
    private List<TGoodsSpecsRent> dayRents;


}
